import re

import requests

from lxml import etree

with open("biancheng.html",'r',encoding="utf-8") as f:
    html = f.read()

    # print(html)


    # 创建解析对象
    parse_html = etree.HTML(html)
    text_list = parse_html.xpath('//div[@class="toggle-target"]//dd/a/text()')
    url_list = parse_html.xpath('//div[@class="toggle-target"]//dd/a/@href')

    items={}
    item_list=[]
    for i in range(len(url_list)):
        items['url'] = url_list[i]
        items['text'] = text_list[i]
        item_list.append(items)

    print(item_list)



